package com.ryenlii.datatrans.core.tcp.run;

import com.ryenlii.datatrans.core.kafka.KafkaService;
import com.ryenlii.datatrans.core.tcp.service.BootNettyChannelInitializer;
import jakarta.annotation.Resource;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author zyzBoole
 * @E-mail zyzbolle@163.com
 * @date 2024/2/19 下午4:18
 */
@Component
public class CustomRunner implements CommandLineRunner {

    @Resource
    private AsyncStartTcp asyncStartTcp;

    @Resource
    private KafkaService kafkaService;

    @Override
    public void run(String... args) {
        asyncStartTcp.start(8889, new BootNettyChannelInitializer<>(kafkaService));
    }

}
